/* 模态框组件样式 */

/* 模态框遮罩 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
  backdrop-filter: blur(2px);
}

/* 模态框内容 */
.modal-content {
  background: white;
  border-radius: 8px;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modal-fade-in 0.3s ease-out;
}

.modal-content.large {
  max-width: 800px;
}

.modal-content.small {
  max-width: 400px;
}

.modal-content.fullscreen {
  max-width: 95vw;
  max-height: 95vh;
  width: 95vw;
  height: 95vh;
}

/* 模态框动画 */
@keyframes modal-fade-in {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 模态框头部 */
.modal-header {
  padding: 1.5rem 2rem 1rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: #f8f9fa;
  color: #333;
}

/* 模态框主体 */
.modal-body {
  padding: 2rem;
}

.modal-body.no-padding {
  padding: 0;
}

/* 模态框底部 */
.modal-footer {
  padding: 1rem 2rem 1.5rem;
  border-top: 1px solid #eee;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.modal-footer.left {
  justify-content: flex-start;
}

.modal-footer.center {
  justify-content: center;
}

.modal-footer.between {
  justify-content: space-between;
}

/* 确认对话框 */
.confirm-modal .modal-content {
  max-width: 400px;
}

.confirm-modal .modal-body {
  text-align: center;
  padding: 2rem;
}

.confirm-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #ffc107;
}

.confirm-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #333;
}

.confirm-message {
  color: #666;
  line-height: 1.5;
  margin-bottom: 2rem;
}

/* 表单模态框 */
.form-modal .modal-content {
  max-width: 600px;
}

/* 查看模态框 */
.view-modal .modal-content {
  max-width: 700px;
}

.view-modal .modal-body {
  padding: 0;
}

.view-content {
  padding: 2rem;
}

/* 全屏模态框 */
.fullscreen-modal .modal-overlay {
  padding: 1rem;
}

.fullscreen-modal .modal-content {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 12px;
}

/* 模态框变体 */
.modal-success .modal-title {
  color: #28a745;
}

.modal-warning .modal-title {
  color: #ffc107;
}

.modal-danger .modal-title {
  color: #dc3545;
}

.modal-info .modal-title {
  color: #17a2b8;
}

/* 模态框加载状态 */
.modal-loading {
  position: relative;
}

.modal-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.modal-loading::before {
  content: '加载中...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #007bff;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* 响应式模态框 */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 1rem;
  }
  
  .modal-content {
    max-width: none;
    width: 100%;
    max-height: 90vh;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  
  .modal-footer {
    flex-direction: column;
  }
  
  .modal-footer .btn {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .modal-overlay {
    padding: 0.5rem;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .modal-title {
    font-size: 1.1rem;
  }
  
  .confirm-icon {
    font-size: 2.5rem;
  }
}

/* 模态框工具类 */
.modal-scrollable {
  overflow-y: auto;
}

.modal-static {
  backdrop-filter: none;
}

.modal-backdrop-static .modal-overlay {
  backdrop-filter: none;
}

/* 模态框动画变体 */
.modal-fade {
  animation: modal-fade-in 0.3s ease-out;
}

.modal-slide-down {
  animation: modal-slide-down 0.3s ease-out;
}

.modal-slide-up {
  animation: modal-slide-up 0.3s ease-out;
}

.modal-zoom {
  animation: modal-zoom 0.3s ease-out;
}

@keyframes modal-slide-down {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-slide-up {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-zoom {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
